package iot_hmbird

// AuthRequest api授权相关
type AuthRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type AuthResponse struct {
	Code    int             `json:"code"`
	Success bool            `json:"success"`
	Time    int64           `json:"t"`
	Result  AccessTokenInfo `json:"result"`
}

type AccessTokenInfo struct {
	AccessToken  string `json:"access_token"`
	Expire       int64  `json:"expire"`
	RefreshToken string `json:"refresh_token"`
}

// CommonResponse 公共返回参数
type CommonResponse struct {
	Success   bool        `json:"success"`
	ErrorCode int         `json:"errorCode"`
	ErrorMsg  string      `json:"errorMsg"`
	Result    interface{} `json:"result"`
}

// InvokeThingServiceRequest api调用设备服务相关
type InvokeThingServiceRequest struct {
	DeviceId    string                 `json:"deviceId"`
	Code        string                 `json:"code"`
	InputParams map[string]interface{} `json:"inputParams"`
}

type InvokeThingServiceResponse struct {
	CommonResponse
	Result ServiceInvokeResult `json:"result"`
}

type ServiceInvokeResult struct {
	Code         string                 `json:"code"`
	OutputParams map[string]interface{} `json:"outputParams"`
}
